package ddd.initializr.api.request;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * 生成请求
 *
 * @author ${author}
 * @since 2022-06-23 22:59
 */
@Getter
@Setter
@ToString
public class GeneratorRequest {

    /**
     * 数据库配置
     */
    private JdbcConfig jdbcConfig;

    /**
     * 全局配置
     */
    private GlobalConfig globalConfig;

    /**
     * 包配置
     */
    private PackageConfig packageConfig;

    /**
     * 策略配置
     */
    private StrategyConfig strategyConfig;


    @Getter
    @Setter
    @ToString
    public class JdbcConfig {

        @NotBlank
        private String url;

        @NotBlank
        private String username;

        @NotBlank
        private String password;
    }

    @Getter
    @Setter
    @ToString
    public class GlobalConfig {

        private String author = "initializr";

        private String pattern = "yyyy-MM-dd HH:mm";

        private String outputDir = "D:\\codes\\yatop\\damp\\demo";
    }

    @Getter
    @Setter
    @ToString
    public class PackageConfig {

        private String name = "ddd.initializr";

        private String moduleName = "demo";

        private String xmlDir = "D:\\codes\\yatop\\damp\\demo";
    }


    @Getter
    @Setter
    @ToString
    public class StrategyConfig {

        private List<String> include;

        private List<String> tablePrefix;

    }


}
